function [gi,dgi] = gcost(macrov,parms);
% given i and param, get convext adjustment cost function (gi) and its
% derivative (dgi)

recvpnew

% % Christiano, Eichenbaum, & Rebelo (2010), as written in Miao and Wang
% gi = in-(ppsi/2)*(in-delta)^2+(ppsi/2)*delta^2;
% dgi = 1-ppsi*(in-delta);

% "standard": g(i) = (ppsi/(1-theta))*i^(1-theta)

%gi = kap*in + (ppsi/(1-theta))*(in^(1-theta));
%dgi = kap + ppsi*(in^(-theta)); 

gi = (ppsi/(1-theta))*(in^(1-theta));
dgi = ppsi*(in^(-theta)); 


end